package legoserver;



import java.awt.*;
import javax.swing.*;

public class ImagePanel extends JPanel {
  Image image;
  int zoom = 100;

  /**
   * constructor
   * @param image
   */
  public ImagePanel(Image image) {
    this.image = image;
  }

  /**
   * overrides the paint method 
   * @param g graphic object
   */
  public void paint(Graphics g) {
    int width = (int) (image.getWidth(this) / 100);
    int height = (int) (image.getHeight(this) / 100);
    super.paint(g); // paint background
    // Draw image at its natural size first.
    g.drawImage(image, 0, 0, width, height, this);
  }
}